Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NET-11043] crd: support request normalization and header match options to prevent L7 intentions bypass #4385

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

zalimeni
Copy link
Member

@zalimeni zalimeni commented Oct 10, 2024

Changes proposed in this PR

Supports changes in hashicorp/consul#21816 with CRD updates:

How I've tested this PR

  • Added unit tests
  • Manually spun up cluster in kind and validated both changes are reflected in xDS / config when created as CRDs

How I expect reviewers to test this PR

👀 + spot check me on the CRD update process in case I missed a step. It's been a while since I've done one of these.

Checklist

@zalimeni zalimeni requested a review from jmurret October 10, 2024 12:16
Copy link
Member Author

@zalimeni zalimeni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmurret this is ready for review, the only blocking change needed is to update the api version in go.mods once it's cut, which should resolve remaining test failures.

I've added backport labels for all active branches, but will likely close the 1.3.x backport in a few days since it's all but certain we won't patch that version again before 1.6.0 GA.

@@ -66,10 +66,56 @@ spec:
http:
description: HTTP defines the HTTP configuration for the service mesh.
properties:
incoming:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs here and below copied from consul changes. Subject to change based on feedback from Docs team.

Comment on lines -67 to -68
required:
- sanitizeXForwardedClientCert
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed by adding omitempty to this field; now that we have multiple fields, requiring this one no longer makes sense. I don't know of any validation we require that a config entry has some explicit fields (service-defaults is allowed to be empty), so I think just removing this is fine.

Comment on lines 5 to 8
// temporary for local dev
replace (
github.com/hashicorp/consul/api => ../../consul-enterprise/api
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be removed once api is cut and updated in this file

Comment on lines +1 to +2
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems this and metrics_util.go were missed on the last codegen update

@zalimeni zalimeni added backport/1.1.x Backport to release/1.1.x branch backport/1.3.x backport/1.4.x backport/1.5.x backport/1.6.x Changes are backported to 1.6 labels Oct 10, 2024
Copy link
Member

@jmurret jmurret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Nice work!

@zalimeni zalimeni changed the title crd: support L7 intentions header match contains and ignoreCase [NET-11043] crd: support L7 intentions header match contains and ignoreCase Oct 12, 2024
@zalimeni zalimeni changed the title [NET-11043] crd: support L7 intentions header match contains and ignoreCase [NET-11043] crd: support request normalization and header match options to prevent L7 intentions bypass Oct 17, 2024
@zalimeni zalimeni force-pushed the zalimeni/net-11043-l7-intentions-updates-support branch from 666ac4e to 29a6637 Compare October 17, 2024 18:30
@zalimeni
Copy link
Member Author

Rebased and squashed for merge

…t L7 intentions bypass

* crd: support L7 intentions header match contains and ignoreCase

* crd: support mesh http.incoming.requestNormalization

* crd: generate updated CRDs

* crd: remove requirement for mesh http.sanitizeXForwardedClientCert

This is a boolean field, and should not be required. Removing the
requirement allows for it to be omitted when other fields are specified.
@zalimeni zalimeni force-pushed the zalimeni/net-11043-l7-intentions-updates-support branch from 29a6637 to 2d3d34e Compare October 17, 2024 19:17
@zalimeni zalimeni enabled auto-merge (squash) October 17, 2024 19:20
@zalimeni zalimeni merged commit bf41f34 into main Oct 17, 2024
50 of 51 checks passed
@zalimeni zalimeni deleted the zalimeni/net-11043-l7-intentions-updates-support branch October 17, 2024 22:17
@zalimeni zalimeni added backport/1.4.x backport/1.6.x Changes are backported to 1.6 and removed backport/1.4.x backport/1.6.x Changes are backported to 1.6 labels Oct 18, 2024
@zalimeni
Copy link
Member Author

Re-initiating backports to fix v2 tests that were disabled on main but not 1.4-1.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.1.x Backport to release/1.1.x branch backport/1.4.x backport/1.5.x backport/1.6.x Changes are backported to 1.6
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants